package com.papers.juan.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.papers.common.core.domain.entity.SysDictData;
import com.papers.common.core.mapper.BaseMapperPlus;
import com.papers.juan.domain.TJuanQuestion;
import com.papers.juan.domain.bean.PaperQuestionInfoBean;
import com.papers.juan.domain.bean.QuestionInfoBean;
import com.papers.juan.domain.bean.QuestionQueryBean;
import com.papers.juan.domain.bean.QuestionTypePropertyBean;
import com.papers.juan.domain.dto.JuanQuestionDto;
import com.papers.juan.domain.vo.KnowledgeReturnVO;
import com.papers.juan.domain.vo.StatisticsByTypeVO;
import com.papers.juan.domain.vo.TJuanQuestionVo;
import com.papers.juan.utils.Node;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 题目Mapper接口
 *
 * @author papers
 * @date 2022-10-08
 */
public interface TJuanQuestionMapper extends BaseMapperPlus<TJuanQuestionMapper, TJuanQuestion, TJuanQuestionVo> {

    /**
     * 获取题量配比列表
     *
     * @param questionQueryBean 题目查询bean
     * @param dictType          字典类型
     * @return 题量配比列表
     */
    List<QuestionTypePropertyBean> queryQuestionCountProportions(@Param("questionQueryBean") QuestionQueryBean questionQueryBean,
                                                                 @Param("dictType") String dictType);

    /**
     * 获取自动生成题目列表
     *
     * @param questionQueryBean 题目查询bean
     * @return 自动生成题目列表
     */
    List<PaperQuestionInfoBean> queryAutoGenerateQuestions(@Param("questionQueryBean") QuestionQueryBean questionQueryBean);

    IPage<TJuanQuestionVo> getQuestionList(IPage<TJuanQuestionVo> page, @Param("dto") JuanQuestionDto dto);

    List<Node> getChapterTreeByQuestion(@Param("courseId") String courseId);

    List<Node> getKnowledgeTreeByQuestion(@Param("courseId") String courseId);

    String queryMaxId();

    /**
     * 根据题目id列表获取题目信息列表
     *
     * @param questionIds 题目id列表
     * @return 题目信息列表
     */
    List<QuestionInfoBean> queryQuestionInfosByIds(@Param("questionIds") List<String> questionIds);

    List<KnowledgeReturnVO> statisticsByKnowledge(String courseId);

    Integer selectAllQuestion(String courseId);

    List<StatisticsByTypeVO> getStatisticsByType(String courseId);

    List<StatisticsByTypeVO> getStatisticsByLevel(String courseId);

    List<TJuanQuestion> getStatisticsByRelevance(String courseId);

    List<StatisticsByTypeVO> getStatisticsByEasy(String courseId);

    List<SysDictData> selectDict(String type);

    List<TJuanQuestion> selectAllQuestionByUser(@Param("questionIds") List<String> tkIds);

    List<KnowledgeReturnVO> getStatisticsByPoint(String courseId);

    List<StatisticsByTypeVO> getStatisticsByImportance(String courseId);

    Integer selectAllScore(String courseId);

    List<TJuanQuestionVo> selectQuestionList(@Param("bo") JuanQuestionDto bo);
}
